/*  ----------------------------------------------------------------------------
 *  Arello Mobile
 *  Fast 3d Engine
 *  ----------------------------------------------------------------------------
 * Except where otherwise noted, this work is licensed under
 * http://creativecommons.org/licenses/by/3.0
 */

#include "Object.h"

namespace liba
{
namespace xml
{

bool Object::on_base_node( Provider * prov, const std::string & name )
{
	if( ansi_object )
		if( ansi_object->on_node( prov, name ) )
			return true;
	if( unicode_object )
		if( unicode_object->on_node( prov, std::wstring( name.begin(), name.end() ) ) )
			return true;
	return false;
}

bool Object::on_base_node( Provider * prov, const std::wstring & name )
{
	if( unicode_object )
		if( unicode_object->on_node( prov, name ) )
			return true;
	if( ansi_object )
		if( ansi_object->on_node( prov, std::string( name.begin(), name.end() ) ) )
			return true;
	return false;
}

bool Object::on_base_node( Provider * prov, const Utf8String & name )
{
	if (unicode_object)
		if (unicode_object->on_node(prov, std::wstring( name.begin(), name.end() ) ))
			return true;
	if (ansi_object)
		if (ansi_object->on_node(prov, std::string( name.begin(), name.end() ) ))
			return true;

	return false;
}

bool Object::on_base_attribute( Provider * prov, const Utf8String & name, const Utf8String & value )
{
	if (unicode_object)
		if (unicode_object->on_attribute(prov, std::wstring( name.begin(), name.end() ), std::wstring( value.begin(), value.end() ) ))
			return true;
	if (ansi_object)
		if (ansi_object->on_attribute(prov, std::string( name.begin(), name.end() ), std::string( value.begin(), value.end() )))
			return true;

	return false;
}


} // namespace xml
} // namespace liba

